using SS.core;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Globalization;
using System.Threading;
using System.Windows.Forms;
namespace SS
{
	public class FrmupdtWareHouse : Form
	{
		public string _WareHouse_ID = string.Empty;
		public string strConnection = "";
		private Func objFunc = new Func();
		private IContainer components = null;
		private TextBox txtName;
		private TextBox txtGCustomer_Notes;
		private TextBox txtID;
		private Label label4;
		private Label label1;
		private Label label6;
		private TextBox txtAddress;
		private Label label7;
		private TextBox txtPhone;
		private Label label9;
		private TextBox txtKeeper;
		private GroupBox groupBox1;
		private Button tSBClose;
		private Button tSBSave;
		private Button tSBAdd;
		private Button btnDel;
		private Label label2;
		private DataGridView dgvStored;
		private Label label3;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column3;
		private DataGridViewTextBoxColumn Column4;
		private BindingNavigator bindingNavigator1;
		private ToolStripLabel bindingNavigatorCountItem;
		private ToolStripButton bindingNavigatorMoveFirstItem;
		private ToolStripButton bindingNavigatorMovePreviousItem;
		private ToolStripSeparator bindingNavigatorSeparator;
		private ToolStripTextBox bindingNavigatorPositionItem;
		private ToolStripSeparator bindingNavigatorSeparator1;
		private ToolStripButton bindingNavigatorMoveNextItem;
		private ToolStripButton bindingNavigatorMoveLastItem;
		private ToolStripSeparator bindingNavigatorSeparator2;
		public FrmupdtWareHouse()
		{
			this.InitializeComponent();
		}
		private void LoadData(string _WareHouse_ID)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand();
			sqlCommand.Connection = sqlConnection;
			sqlCommand.CommandText = "SELECT * FROM TabWareHouse WHERE  WareHouse_ID ='" + _WareHouse_ID + "'";
			sqlConnection.Open();
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					this.txtID.Text = sqlDataReader["WareHouse_ID"].ToString();
					this.txtName.Text = sqlDataReader["WareHouse_Name"].ToString();
					this.txtAddress.Text = sqlDataReader["WareHouse_Address"].ToString();
					this.txtPhone.Text = sqlDataReader["WareHouse_Phone"].ToString();
					this.txtKeeper.Text = sqlDataReader["WareHouse_Keeper"].ToString();
					this.txtGCustomer_Notes.Text = sqlDataReader["WareHouse_Notes"].ToString();
				}
			}
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private void frmupdtCustomer_Load(object sender, EventArgs e)
		{
			Program.strConnectionString = this.objFunc.strConnectionString;
			wareHouse wareHouse = new wareHouse();
			wareHouse.loadToDataGridView(this.dgvStored, this.bindingNavigator1);
			Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
			if (this._WareHouse_ID != string.Empty)
			{
				this.LoadData(this._WareHouse_ID);
				this.txtID.Enabled = false;
			}
		}
		private void OnUpdate(int _act)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand("ActionOnTabWareHouse", sqlConnection);
			sqlCommand.CommandType = CommandType.StoredProcedure;
			sqlCommand.Parameters.Add("@WareHouse_ID", SqlDbType.NVarChar, 50);
			sqlCommand.Parameters.Add("@WareHouse_Name", SqlDbType.NVarChar, 200);
			sqlCommand.Parameters.Add("@WareHouse_Address", SqlDbType.NVarChar, 300);
			sqlCommand.Parameters.Add("@WareHouse_Phone", SqlDbType.NVarChar, 50);
			sqlCommand.Parameters.Add("@WareHouse_Keeper", SqlDbType.NVarChar, 100);
			sqlCommand.Parameters.Add("@WareHouse_Notes", SqlDbType.NVarChar, 500);
			sqlCommand.Parameters.Add("@Act", SqlDbType.SmallInt);
			sqlCommand.Parameters["@WareHouse_ID"].Value = this.txtID.Text.Trim().ToUpper();
			sqlCommand.Parameters["@WareHouse_Name"].Value = this.txtName.Text;
			sqlCommand.Parameters["@WareHouse_Address"].Value = this.txtAddress.Text;
			sqlCommand.Parameters["@WareHouse_Phone"].Value = this.txtPhone.Text;
			sqlCommand.Parameters["@WareHouse_Keeper"].Value = this.txtKeeper.Text;
			sqlCommand.Parameters["@WareHouse_Notes"].Value = this.txtGCustomer_Notes.Text;
			sqlCommand.Parameters["@Act"].Value = _act;
			sqlConnection.Open();
			sqlCommand.ExecuteNonQuery();
			this._WareHouse_ID = this.txtID.Text;
			sqlConnection.Close();
			sqlConnection.Dispose();
			wareHouse wareHouse = new wareHouse();
			wareHouse.loadToDataGridView(this.dgvStored, this.bindingNavigator1);
		}
		private void tSBSave_Click(object sender, EventArgs e)
		{
			if (this.txtID.Text != string.Empty && this.txtName.Text != string.Empty)
			{
				if (this._WareHouse_ID != string.Empty)
				{
					this.OnUpdate(1);
					this.tSBAdd.Focus();
				}
				else
				{
					if (!this.CheckValue(this.txtID.Text.Trim().ToUpper()))
					{
						this.OnUpdate(0);
						this.tSBAdd.Focus();
					}
					else
					{
						MessageBox.Show("Mã kho " + this.txtID.Text.Trim().ToUpper() + " đã tồn tại trong hệ thống!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
					}
				}
			}
			else
			{
				MessageBox.Show("Xin vui lòng điền đầy đủ thông tin cần thiết!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
		}
		private bool CheckValue(string _WareHouseID)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand("SELECT * FROM TabWareHouse WHERE WareHouse_ID = @WareHouse_ID", sqlConnection);
			sqlCommand.Parameters.Add("@WareHouse_ID", SqlDbType.NVarChar, 50);
			sqlCommand.Parameters["@WareHouse_ID"].Value = _WareHouseID;
			sqlConnection.Open();
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			bool result = sqlDataReader.HasRows;
			sqlConnection.Close();
			sqlConnection.Dispose();
			return result;
		}
		private void tSBAdd_Click(object sender, EventArgs e)
		{
			this.txtID.Enabled = true;
			this.txtID.Text = "";
			this.txtName.Text = "";
			this.txtAddress.Text = "";
			this.txtPhone.Text = "";
			this.txtKeeper.Text = "";
			this.txtGCustomer_Notes.Text = "";
			this._WareHouse_ID = "";
			this.txtID.Focus();
		}
		public void DeleteGCustomer(string _WareHouseID)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand("DELETE FROM TabWareHouse WHERE  [WareHouse_ID] = @WareHouse_ID", sqlConnection);
			sqlCommand.Parameters.Add("@WareHouse_ID", SqlDbType.NVarChar, 50);
			sqlCommand.Parameters["@WareHouse_ID"].Value = _WareHouseID;
			sqlConnection.Open();
			sqlCommand.ExecuteNonQuery();
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private void txtID_Enter(object sender, EventArgs e)
		{
			this.txtID.BackColor = Color.Aqua;
		}
		private void txtName_Enter(object sender, EventArgs e)
		{
			this.txtName.BackColor = Color.Aqua;
		}
		private void txtAddress_Enter(object sender, EventArgs e)
		{
			this.txtAddress.BackColor = Color.Aqua;
		}
		private void txtPhone_Enter(object sender, EventArgs e)
		{
			this.txtPhone.BackColor = Color.Aqua;
		}
		private void txtGCustomer_Notes_Enter(object sender, EventArgs e)
		{
			this.txtGCustomer_Notes.BackColor = Color.Aqua;
		}
		private void txtKeeper_Enter(object sender, EventArgs e)
		{
			this.txtKeeper.BackColor = Color.Aqua;
		}
		private void txtID_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtName.Focus();
			}
		}
		private void txtName_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtAddress.Focus();
			}
		}
		private void txtAddress_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtPhone.Focus();
			}
		}
		private void txtPhone_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtKeeper.Focus();
			}
		}
		private void txtKeeper_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtGCustomer_Notes.Focus();
			}
		}
		private void txtID_Leave(object sender, EventArgs e)
		{
			this.txtID.BackColor = Color.White;
		}
		private void txtName_Leave(object sender, EventArgs e)
		{
			this.txtName.BackColor = Color.White;
		}
		private void txtAddress_Leave(object sender, EventArgs e)
		{
			this.txtAddress.BackColor = Color.White;
		}
		private void txtPhone_Leave(object sender, EventArgs e)
		{
			this.txtPhone.BackColor = Color.White;
		}
		private void txtGCustomer_Notes_Leave(object sender, EventArgs e)
		{
			this.txtGCustomer_Notes.BackColor = Color.White;
		}
		private void txtKeeper_Leave(object sender, EventArgs e)
		{
			this.txtKeeper.BackColor = Color.White;
		}
		private void tSBClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void btnDel_Click(object sender, EventArgs e)
		{
			try
			{
				wareHouse wareHouse = new wareHouse();
				if (MessageBox.Show("Có phải bạn muốn xoá mục được chọn không?\r\n\r\nBấm YES nếu đồng ý xoá, Bấm NO để bỏ qua!", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
				{
					string text = this.CheckWareHouseExitstInRep(this._WareHouse_ID);
					if (text.Trim() != "")
					{
						MessageBox.Show("Kho hàng  \"" + this.txtName.Text + "\" đã giao dịch trên các hoá đơn\r\n\r\nBạn phải xóa hết hóa đơn giao dịch của kho hàng này trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
						wareHouse.loadToDataGridView(this.dgvStored, this.bindingNavigator1);
						return;
					}
					wareHouse.del(this._WareHouse_ID);
				}
				wareHouse.loadToDataGridView(this.dgvStored, this.bindingNavigator1);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private string CheckWareHouseExitstInRep(string tmpAutoID)
		{
			string text = "";
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			try
			{
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.CommandText = "SELECT [WID] FROM [TabBill] WHERE [WID] = '" + tmpAutoID + "'";
				SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
				int num = 1;
				if (sqlDataReader.HasRows)
				{
					while (sqlDataReader.Read())
					{
						if (num == 1)
						{
							text += sqlDataReader["WID"].ToString();
							num = 2;
						}
						else
						{
							text = text + "," + sqlDataReader["WID"].ToString();
						}
					}
				}
				sqlDataReader.Close();
				sqlDataReader.Dispose();
			}
			catch
			{
			}
			sqlConnection.Close();
			sqlConnection.Dispose();
			return text;
		}
		private void FrmupdtWareHouse_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.F4)
			{
				this.tSBAdd.PerformClick();
			}
			else
			{
				if (e.KeyCode == Keys.F6)
				{
					this.tSBSave.PerformClick();
				}
				else
				{
					if (e.KeyCode == Keys.F8)
					{
						this.btnDel.PerformClick();
					}
					else
					{
						if (e.KeyCode == Keys.Escape)
						{
							base.Close();
						}
					}
				}
			}
		}
		private void dgvNational_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				this._WareHouse_ID = this.dgvStored.Rows[e.RowIndex].Cells["Column1"].Value.ToString();
				wareHouse wareHouse = new wareHouse();
				wareHouse.getInfo(this._WareHouse_ID, this.txtID, this.txtName, this.txtAddress, this.txtPhone, this.txtKeeper, this.txtGCustomer_Notes);
			}
			catch
			{
			}
		}
		private void txtGCustomer_Notes_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.tSBSave.PerformClick();
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrmupdtWareHouse));
			this.txtName = new TextBox();
			this.txtGCustomer_Notes = new TextBox();
			this.txtID = new TextBox();
			this.label4 = new Label();
			this.label1 = new Label();
			this.label6 = new Label();
			this.txtAddress = new TextBox();
			this.label7 = new Label();
			this.txtPhone = new TextBox();
			this.label9 = new Label();
			this.txtKeeper = new TextBox();
			this.groupBox1 = new GroupBox();
			this.label2 = new Label();
			this.tSBClose = new Button();
			this.tSBSave = new Button();
			this.tSBAdd = new Button();
			this.btnDel = new Button();
			this.dgvStored = new DataGridView();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			this.Column4 = new DataGridViewTextBoxColumn();
			this.label3 = new Label();
			this.bindingNavigator1 = new BindingNavigator(this.components);
			this.bindingNavigatorCountItem = new ToolStripLabel();
			this.bindingNavigatorMoveFirstItem = new ToolStripButton();
			this.bindingNavigatorMovePreviousItem = new ToolStripButton();
			this.bindingNavigatorSeparator = new ToolStripSeparator();
			this.bindingNavigatorPositionItem = new ToolStripTextBox();
			this.bindingNavigatorSeparator1 = new ToolStripSeparator();
			this.bindingNavigatorMoveNextItem = new ToolStripButton();
			this.bindingNavigatorMoveLastItem = new ToolStripButton();
			this.bindingNavigatorSeparator2 = new ToolStripSeparator();
			this.groupBox1.SuspendLayout();
			((ISupportInitialize)this.dgvStored).BeginInit();
			((ISupportInitialize)this.bindingNavigator1).BeginInit();
			this.bindingNavigator1.SuspendLayout();
			base.SuspendLayout();
			this.txtName.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtName.Location = new Point(324, 19);
			this.txtName.Name = "txtName";
			this.txtName.Size = new Size(551, 21);
			this.txtName.TabIndex = 2;
			this.txtName.Leave += new EventHandler(this.txtName_Leave);
			this.txtName.KeyPress += new KeyPressEventHandler(this.txtName_KeyPress);
			this.txtName.Enter += new EventHandler(this.txtName_Enter);
			this.txtGCustomer_Notes.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtGCustomer_Notes.Location = new Point(154, 127);
			this.txtGCustomer_Notes.Name = "txtGCustomer_Notes";
			this.txtGCustomer_Notes.Size = new Size(721, 21);
			this.txtGCustomer_Notes.TabIndex = 6;
			this.txtGCustomer_Notes.Leave += new EventHandler(this.txtGCustomer_Notes_Leave);
			this.txtGCustomer_Notes.KeyPress += new KeyPressEventHandler(this.txtGCustomer_Notes_KeyPress);
			this.txtGCustomer_Notes.Enter += new EventHandler(this.txtGCustomer_Notes_Enter);
			this.txtID.CharacterCasing = CharacterCasing.Upper;
			this.txtID.Location = new Point(154, 19);
			this.txtID.Name = "txtID";
			this.txtID.Size = new Size(96, 21);
			this.txtID.TabIndex = 1;
			this.txtID.Leave += new EventHandler(this.txtID_Leave);
			this.txtID.KeyPress += new KeyPressEventHandler(this.txtID_KeyPress);
			this.txtID.Enter += new EventHandler(this.txtID_Enter);
			this.label4.BackColor = Color.FromArgb(255, 255, 192);
			this.label4.BorderStyle = BorderStyle.Fixed3D;
			this.label4.Location = new Point(33, 127);
			this.label4.Name = "label4";
			this.label4.Size = new Size(118, 21);
			this.label4.TabIndex = 16;
			this.label4.Text = "Ghi chú :";
			this.label4.TextAlign = ContentAlignment.MiddleRight;
			this.label1.BackColor = Color.FromArgb(255, 255, 192);
			this.label1.BorderStyle = BorderStyle.Fixed3D;
			this.label1.Location = new Point(33, 19);
			this.label1.Name = "label1";
			this.label1.Size = new Size(118, 21);
			this.label1.TabIndex = 11;
			this.label1.Text = "Mã kho :";
			this.label1.TextAlign = ContentAlignment.MiddleRight;
			this.label6.BackColor = Color.FromArgb(255, 255, 192);
			this.label6.BorderStyle = BorderStyle.Fixed3D;
			this.label6.Location = new Point(33, 46);
			this.label6.Name = "label6";
			this.label6.Size = new Size(118, 21);
			this.label6.TabIndex = 21;
			this.label6.Text = "Địa chỉ :";
			this.label6.TextAlign = ContentAlignment.MiddleRight;
			this.txtAddress.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtAddress.Location = new Point(154, 46);
			this.txtAddress.Name = "txtAddress";
			this.txtAddress.Size = new Size(721, 21);
			this.txtAddress.TabIndex = 3;
			this.txtAddress.Leave += new EventHandler(this.txtAddress_Leave);
			this.txtAddress.KeyPress += new KeyPressEventHandler(this.txtAddress_KeyPress);
			this.txtAddress.Enter += new EventHandler(this.txtAddress_Enter);
			this.label7.BackColor = Color.FromArgb(255, 255, 192);
			this.label7.BorderStyle = BorderStyle.Fixed3D;
			this.label7.Location = new Point(33, 73);
			this.label7.Name = "label7";
			this.label7.Size = new Size(118, 21);
			this.label7.TabIndex = 23;
			this.label7.Text = "Điện thoại :";
			this.label7.TextAlign = ContentAlignment.MiddleRight;
			this.txtPhone.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtPhone.Location = new Point(154, 73);
			this.txtPhone.Name = "txtPhone";
			this.txtPhone.Size = new Size(721, 21);
			this.txtPhone.TabIndex = 4;
			this.txtPhone.Leave += new EventHandler(this.txtPhone_Leave);
			this.txtPhone.KeyPress += new KeyPressEventHandler(this.txtPhone_KeyPress);
			this.txtPhone.Enter += new EventHandler(this.txtPhone_Enter);
			this.label9.BackColor = Color.FromArgb(255, 255, 192);
			this.label9.BorderStyle = BorderStyle.Fixed3D;
			this.label9.Location = new Point(33, 100);
			this.label9.Name = "label9";
			this.label9.Size = new Size(118, 21);
			this.label9.TabIndex = 27;
			this.label9.Text = "Thủ kho :";
			this.label9.TextAlign = ContentAlignment.MiddleRight;
			this.txtKeeper.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtKeeper.Location = new Point(154, 100);
			this.txtKeeper.Name = "txtKeeper";
			this.txtKeeper.Size = new Size(721, 21);
			this.txtKeeper.TabIndex = 5;
			this.txtKeeper.Leave += new EventHandler(this.txtKeeper_Leave);
			this.txtKeeper.KeyPress += new KeyPressEventHandler(this.txtKeeper_KeyPress);
			this.txtKeeper.Enter += new EventHandler(this.txtKeeper_Enter);
			this.groupBox1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox1.BackColor = Color.Transparent;
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label9);
			this.groupBox1.Controls.Add(this.txtGCustomer_Notes);
			this.groupBox1.Controls.Add(this.txtKeeper);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Controls.Add(this.txtID);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.txtName);
			this.groupBox1.Controls.Add(this.txtPhone);
			this.groupBox1.Controls.Add(this.txtAddress);
			this.groupBox1.Location = new Point(6, 399);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(888, 162);
			this.groupBox1.TabIndex = 31;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Thông tin về kho hàng";
			this.label2.BackColor = Color.FromArgb(255, 255, 192);
			this.label2.BorderStyle = BorderStyle.Fixed3D;
			this.label2.Location = new Point(257, 19);
			this.label2.Name = "label2";
			this.label2.Size = new Size(64, 21);
			this.label2.TabIndex = 67;
			this.label2.Text = "Tên gọi :";
			this.label2.TextAlign = ContentAlignment.MiddleRight;
			this.tSBClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.tSBClose.BackColor = SystemColors.ButtonFace;
			this.tSBClose.Cursor = Cursors.Hand;
			this.tSBClose.FlatAppearance.BorderColor = Color.Gray;
			this.tSBClose.FlatStyle = FlatStyle.System;
			this.tSBClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBClose.ImageAlign = ContentAlignment.MiddleLeft;
//			this.tSBClose.ImeMode = ImeMode.NoControl;
			this.tSBClose.Location = new Point(795, 567);
			this.tSBClose.Name = "tSBClose";
			this.tSBClose.Size = new Size(99, 28);
			this.tSBClose.TabIndex = 63;
			this.tSBClose.Text = "Thoát  [ ESC ]";
			this.tSBClose.UseVisualStyleBackColor = false;
			this.tSBClose.Click += new EventHandler(this.tSBClose_Click);
			this.tSBSave.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.tSBSave.BackColor = SystemColors.ButtonFace;
			this.tSBSave.Cursor = Cursors.Hand;
			this.tSBSave.FlatAppearance.BorderColor = Color.Gray;
			this.tSBSave.FlatStyle = FlatStyle.System;
			this.tSBSave.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBSave.ImageAlign = ContentAlignment.MiddleLeft;
//			this.tSBSave.ImeMode = ImeMode.NoControl;
			this.tSBSave.Location = new Point(108, 567);
			this.tSBSave.Name = "tSBSave";
			this.tSBSave.Size = new Size(99, 28);
			this.tSBSave.TabIndex = 62;
			this.tSBSave.Text = "Ghi nhận  [ F6 ]";
			this.tSBSave.UseVisualStyleBackColor = false;
			this.tSBSave.Click += new EventHandler(this.tSBSave_Click);
			this.tSBAdd.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.tSBAdd.BackColor = SystemColors.ButtonFace;
			this.tSBAdd.Cursor = Cursors.Hand;
			this.tSBAdd.FlatAppearance.BorderColor = Color.Gray;
			this.tSBAdd.FlatStyle = FlatStyle.System;
			this.tSBAdd.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBAdd.ImageAlign = ContentAlignment.MiddleLeft;
//			////this.tSBAdd.ImeMode = ImeMode.NoControl;
			this.tSBAdd.Location = new Point(6, 567);
			this.tSBAdd.Name = "tSBAdd";
			this.tSBAdd.Size = new Size(99, 28);
			this.tSBAdd.TabIndex = 61;
			this.tSBAdd.Text = "Thêm kho [ F4 ]";
			this.tSBAdd.UseVisualStyleBackColor = false;
			this.tSBAdd.Click += new EventHandler(this.tSBAdd_Click);
			this.btnDel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnDel.BackColor = SystemColors.ButtonFace;
			this.btnDel.Cursor = Cursors.Hand;
			this.btnDel.FlatAppearance.BorderColor = Color.Gray;
			this.btnDel.FlatStyle = FlatStyle.System;
			this.btnDel.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnDel.ImageAlign = ContentAlignment.MiddleLeft;
			this.btnDel.Location = new Point(210, 567);
			this.btnDel.Name = "btnDel";
			this.btnDel.Size = new Size(99, 28);
			this.btnDel.TabIndex = 66;
			this.btnDel.Text = "Xoá kho [ F8 ]";
			this.btnDel.UseVisualStyleBackColor = false;
			this.btnDel.Click += new EventHandler(this.btnDel_Click);
			this.dgvStored.AllowUserToAddRows = false;
			this.dgvStored.AllowUserToDeleteRows = false;
			this.dgvStored.AllowUserToResizeColumns = false;
			this.dgvStored.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvStored.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvStored.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvStored.BackgroundColor = Color.White;
			this.dgvStored.BorderStyle = BorderStyle.Fixed3D;
			this.dgvStored.ColumnHeadersHeight = 26;
			this.dgvStored.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvStored.Columns.AddRange(new DataGridViewColumn[]
			{
				this.Column1,
				this.Column2,
				this.Column3,
				this.Column4
			});
			this.dgvStored.Cursor = Cursors.Hand;
			this.dgvStored.EnableHeadersVisualStyles = false;
			this.dgvStored.Location = new Point(6, 35);
			this.dgvStored.Name = "dgvStored";
			this.dgvStored.ReadOnly = true;
			this.dgvStored.RowHeadersVisible = false;
			this.dgvStored.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvStored.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvStored.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvStored.Size = new Size(888, 332);
			this.dgvStored.TabIndex = 67;
			this.dgvStored.CellEnter += new DataGridViewCellEventHandler(this.dgvNational_CellEnter);
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "WareHouse_ID";
			this.Column1.HeaderText = "Số hiệu kho";
			this.Column1.MinimumWidth = 150;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.Width = 150;
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column2.DataPropertyName = "WareHouse_Name";
			this.Column2.HeaderText = "Tên kho";
			this.Column2.MinimumWidth = 250;
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column2.Width = 250;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "WareHouse_Keeper";
			this.Column3.HeaderText = "Thủ kho";
			this.Column3.MinimumWidth = 200;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.Width = 200;
			this.Column4.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.Column4.DataPropertyName = "WareHouse_Notes";
			this.Column4.HeaderText = "Diễn giải";
			this.Column4.Name = "Column4";
			this.Column4.ReadOnly = true;
			this.label3.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.label3.BackColor = Color.Transparent;
			this.label3.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.label3.Location = new Point(7, 9);
			this.label3.Name = "label3";
			this.label3.Size = new Size(887, 23);
			this.label3.TabIndex = 68;
			this.label3.Text = "HỆ THỐNG KHO HÀNG";
			this.label3.TextAlign = ContentAlignment.MiddleCenter;
			this.bindingNavigator1.AddNewItem = null;
			this.bindingNavigator1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.bindingNavigator1.AutoSize = false;
			this.bindingNavigator1.BackColor = SystemColors.ButtonFace;
			this.bindingNavigator1.CountItem = this.bindingNavigatorCountItem;
			this.bindingNavigator1.CountItemFormat = "/ {0}";
			this.bindingNavigator1.DeleteItem = null;
			this.bindingNavigator1.Dock = DockStyle.None;
			this.bindingNavigator1.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigator1.GripStyle = ToolStripGripStyle.Hidden;
			this.bindingNavigator1.Items.AddRange(new ToolStripItem[]
			{
				this.bindingNavigatorMoveFirstItem,
				this.bindingNavigatorMovePreviousItem,
				this.bindingNavigatorSeparator,
				this.bindingNavigatorPositionItem,
				this.bindingNavigatorCountItem,
				this.bindingNavigatorSeparator1,
				this.bindingNavigatorMoveNextItem,
				this.bindingNavigatorMoveLastItem,
				this.bindingNavigatorSeparator2
			});
			this.bindingNavigator1.Location = new Point(6, 370);
			this.bindingNavigator1.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
			this.bindingNavigator1.MoveLastItem = this.bindingNavigatorMoveLastItem;
			this.bindingNavigator1.MoveNextItem = this.bindingNavigatorMoveNextItem;
			this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
			this.bindingNavigator1.Name = "bindingNavigator1";
			this.bindingNavigator1.PositionItem = this.bindingNavigatorPositionItem;
			this.bindingNavigator1.RenderMode = ToolStripRenderMode.Professional;
			this.bindingNavigator1.Size = new Size(888, 25);
			this.bindingNavigator1.TabIndex = 146;
			this.bindingNavigator1.Text = "bindingNavigator1";
			this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
			this.bindingNavigatorCountItem.Size = new Size(28, 22);
			this.bindingNavigatorCountItem.Text = "/ {0}";
			this.bindingNavigatorCountItem.ToolTipText = "Total number of items";
			this.bindingNavigatorMoveFirstItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveFirstItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveFirstItem.Image");
			this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
			this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveFirstItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveFirstItem.Text = "Move first";
			this.bindingNavigatorMovePreviousItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
			//this.bindingNavigatorMovePreviousItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMovePreviousItem.Image");
			this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
			this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMovePreviousItem.Size = new Size(23, 22);
			this.bindingNavigatorMovePreviousItem.Text = "Move previous";
			this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
			this.bindingNavigatorSeparator.Size = new Size(6, 25);
			this.bindingNavigatorPositionItem.AccessibleName = "Position";
			this.bindingNavigatorPositionItem.AutoSize = false;
			this.bindingNavigatorPositionItem.BackColor = SystemColors.ButtonFace;
			this.bindingNavigatorPositionItem.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
			this.bindingNavigatorPositionItem.Size = new Size(50, 21);
			this.bindingNavigatorPositionItem.Text = "0";
			this.bindingNavigatorPositionItem.TextBoxTextAlign = HorizontalAlignment.Center;
			this.bindingNavigatorPositionItem.ToolTipText = "Current position";
			this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
			this.bindingNavigatorSeparator1.Size = new Size(6, 25);
			this.bindingNavigatorMoveNextItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
			//this.bindingNavigatorMoveNextItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveNextItem.Image");
			this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
			this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveNextItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveNextItem.Text = "Move next";
			this.bindingNavigatorMoveLastItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
			//this.bindingNavigatorMoveLastItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveLastItem.Image");
			this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
			this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveLastItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveLastItem.Text = "Move last";
			this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2";
			this.bindingNavigatorSeparator2.Size = new Size(6, 25);
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(900, 600);
			base.Controls.Add(this.bindingNavigator1);
			base.Controls.Add(this.label3);
			base.Controls.Add(this.dgvStored);
			base.Controls.Add(this.btnDel);
			base.Controls.Add(this.tSBClose);
			base.Controls.Add(this.tSBSave);
			base.Controls.Add(this.tSBAdd);
			base.Controls.Add(this.groupBox1);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			base.Name = "FrmupdtWareHouse";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "Kho hàng";
			base.Load += new EventHandler(this.frmupdtCustomer_Load);
			base.KeyDown += new KeyEventHandler(this.FrmupdtWareHouse_KeyDown);
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			((ISupportInitialize)this.dgvStored).EndInit();
			((ISupportInitialize)this.bindingNavigator1).EndInit();
			this.bindingNavigator1.ResumeLayout(false);
			this.bindingNavigator1.PerformLayout();
			base.ResumeLayout(false);
		}
	}
}
